﻿<%@ Page Language="C#" MasterPageFile="~/Global/SubUser.Master" AutoEventWireup="true"
    CodeBehind="prolist.aspx.cs" Inherits="TVC_WEB.Global.prolist" Title="Untitled Page" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .productItem
        {
            width: 169px;
            float: left;
            padding: 5px;
            margin: 5px;
            text-align: center;
        }
        .groupSeparator
        {
            border-top: 1px dotted Gray;
            height: 1px;
            clear: both;
        }
        .itemSeparator
        {
            height: 193px;
            width: 1px;
            border-left: 1px dotted Gray;
            float: left;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div id="breadcrumb">
        <p class="first">
            <asp:Literal ID="lbCatePath" runat="server" Mode="PassThrough"></asp:Literal>
        </p>
    </div>
    <h1>
        <asp:Literal ID="lbCateName" runat="server" Mode="PassThrough"></asp:Literal></h1>
    <div class="p" id="product_list">
        <div>
            <table class="alternatet" style="background-image: none; border: 0px;">
                <tbody>
                    <tr>
                        <td align="left">
                            <asp:DataPager ID="dpdgvList" runat="server" PagedControlID="lvPro" PageSize="10">
                                <Fields>
                                    <asp:TemplatePagerField>
                                        <PagerTemplate>
                                            Page
                                            <%# Container.TotalRowCount > 0 ? (Container.StartRowIndex / Container.PageSize) + 1 : 0 %>
                                            of
                                            <%#  Math.Ceiling ((double)Container.TotalRowCount / Container.PageSize) %>
                                            (<%# Container.TotalRowCount%>
                                            Items)
                                        </PagerTemplate>
                                    </asp:TemplatePagerField>
                                </Fields>
                            </asp:DataPager>
                        </td>
                        <td align="right">
                            Sắp xếp theo:&nbsp;&nbsp;&nbsp;<asp:LinkButton ID="lkName" runat="server" OnClick="lkName_Click">Tên</asp:LinkButton>
                            &nbsp;&nbsp;
                            <asp:LinkButton ID="lbNewest" runat="server" OnClick="lbNewest_Click">Mới nhất</asp:LinkButton>
                            &nbsp;&nbsp;
                            <asp:LinkButton ID="lkPriceAsc" runat="server" OnClick="lkPriceAsc_Click">Giá tăng</asp:LinkButton>&nbsp;&nbsp;
                            <asp:LinkButton ID="lkPriceDesc" runat="server" OnClick="lkPriceDesc_Click">Giá giảm</asp:LinkButton>&nbsp;&nbsp;
                            <asp:LinkButton ID="lbTopSell" runat="server" OnClick="lbTopSell_Click">Bán chạy</asp:LinkButton>
                            <asp:HiddenField ID="hdSort" runat="server" Value="NameVN" />
                        </td>
                    </tr>
                    <tr class="alt">
                        <td colspan="2" style="padding: 0px">
                            <center>
                                <div class="hrd">
                                    <hr />
                                </div>
                            </center>
                        </td>
                    </tr>
                </tbody>
            </table>
            <table class="alternateb" style="background-image: none; border: 0px; margin-bottom: 1em;">
                <tbody>
                    <tr>
                        <td align="left">
                            <asp:DataPager ID="DataPager1" runat="server" PagedControlID="lvPro" PageSize="10"
                                OnPreRender="DataPager_PreRender">
                                <Fields>
                                    <asp:NextPreviousPagerField FirstPageText="&lt;&lt;" PreviousPageText="&lt;" ShowFirstPageButton="True"
                                        ShowNextPageButton="False" />
                                    <asp:NumericPagerField />
                                    <asp:NextPreviousPagerField LastPageText="&gt;&gt;" NextPageText="&gt;" ShowLastPageButton="True"
                                        ShowPreviousPageButton="False" />
                                </Fields>
                            </asp:DataPager>
                        </td>
                        <td align="right">
                            <a href="#" rel="nofollow">Tất cả sản phẩm</a>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
        <asp:ListView ID="lvPro" runat="server" GroupItemCount="3">
            <LayoutTemplate>
                <div style="width: 100%;">
                    <asp:PlaceHolder runat="server" ID="groupPlaceHolder" />
                </div>
            </LayoutTemplate>
            <EmptyDataTemplate>
                <div style="width: 100%;">
                    Sorry, no results were found, please widen your search
                </div>
            </EmptyDataTemplate>
            <GroupTemplate>
                <div style="clear: both;">
                    <asp:PlaceHolder runat="server" ID="itemPlaceHolder" />
                </div>
            </GroupTemplate>
            <ItemTemplate>
                <div class="productItem">
                    <div align="left">
                        <p class="first" style="text-align: center;">
                            Mã:
                            <%# Eval("Code").ToString()%>
                        </p>
                        <div class="primw">
                            <div class="prim">
                                <div style="position: absolute; margin-left: 130px; margin-top: -10px; height: 25px;
                                    width: 25px">
                                    <img src="<%#GetImage(Eval("Icon").ToString()) %>" width="25px" />
                                </div>
                                <a href="/Global/prodetail.aspx?id=<%# Eval("ID").ToString()%>">
                                    <img src="<%#GetImage(Eval("Image").ToString()) %>" width="150" height="99" hspace="0"
                                        vspace="0" alt="<%# Eval("NameVN").ToString()%>"></a></div>
                        </div>
                        <p>
                        </p>
                        <p class="last">
                            <span class="prti"><a href="/Global/prodetail.aspx?id=<%# Eval("ID").ToString()%>"><b>
                                <%# Eval("NameVN").ToString()%></b></a></span><span class="gap"><font class="selling_price"><b><%# GetPrice(Eval("NewPrice").ToString())%></b></font></span></p>
                    </div>
                </div>
            </ItemTemplate>
            <ItemSeparatorTemplate>
                <div class="itemSeparator">
                </div>
            </ItemSeparatorTemplate>
            <GroupSeparatorTemplate>
                <div class="groupSeparator">
                </div>
            </GroupSeparatorTemplate>
            <EmptyDataTemplate>
            </EmptyDataTemplate>
        </asp:ListView>
        <table class="alternateb" style="background-image: none; border: 0px;">
            <tbody>
                <tr>
                    <td align="left">
                        <asp:DataPager ID="DataPager3" runat="server" PagedControlID="lvPro" PageSize="10"
                            OnPreRender="DataPager_PreRender">
                            <Fields>
                                <asp:NextPreviousPagerField FirstPageText="&lt;&lt;" PreviousPageText="&lt;" ShowFirstPageButton="True"
                                    ShowNextPageButton="False" />
                                <asp:NumericPagerField />
                                <asp:NextPreviousPagerField LastPageText="&gt;&gt;" NextPageText="&gt;" ShowLastPageButton="True"
                                    ShowPreviousPageButton="False" />
                            </Fields>
                        </asp:DataPager>
                    </td>
                    <td align="right">
                        <a href="#" rel="nofollow">Tất cả sản phẩm</a>
                    </td>
                </tr>
                <tr class="alt">
                    <td colspan="2" style="padding: 0px">
                        <center>
                            <div class="hrd">
                                <hr />
                            </div>
                        </center>
                    </td>
                </tr>
            </tbody>
        </table>
        <table class="alternatet" style="background-image: none; border: 0px; margin-bottom: 1em;">
            <tbody>
                <tr>
                    <td align="left">
                        <asp:DataPager ID="DataPager2" runat="server" PagedControlID="lvPro" PageSize="10">
                            <Fields>
                                <asp:TemplatePagerField>
                                    <PagerTemplate>
                                        Page
                                        <%# Container.TotalRowCount > 0 ? (Container.StartRowIndex / Container.PageSize) + 1 : 0 %>
                                        of
                                        <%#  Math.Ceiling ((double)Container.TotalRowCount / Container.PageSize) %>
                                        (<%# Container.TotalRowCount%>
                                        Items)
                                    </PagerTemplate>
                                </asp:TemplatePagerField>
                            </Fields>
                        </asp:DataPager>
                    </td>
                    <td align="right">
                        Sắp xếp theo:&nbsp;&nbsp;&nbsp;<asp:LinkButton ID="LinkButton1" runat="server" OnClick="lkName_Click">Tên</asp:LinkButton>
                        &nbsp;&nbsp;
                        <asp:LinkButton ID="LinkButton2" runat="server" OnClick="lbNewest_Click">Mới nhất</asp:LinkButton>
                        &nbsp;&nbsp;
                        <asp:LinkButton ID="LinkButton3" runat="server" OnClick="lkPriceAsc_Click">Giá tăng</asp:LinkButton>&nbsp;&nbsp;
                        <asp:LinkButton ID="LinkButton4" runat="server" OnClick="lkPriceDesc_Click">Giá giảm</asp:LinkButton>&nbsp;&nbsp;
                        <asp:LinkButton ID="LinkButton5" runat="server" OnClick="lbTopSell_Click">Bán chạy</asp:LinkButton>
                    </td>
                </tr>
            </tbody>
        </table>
    </div>
    <div class="clear">
    </div>
</asp:Content>
